package com.magiccompass.alipay.barcode.entity;

import java.sql.Timestamp;
import java.util.Calendar;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicUpdate;

import com.magiccompass.alipay.barcode.constants.BusinessLogicConstants;

@Entity
@Table(name = "TD_MERCHANT_BANK_ACCOUNT")
@DynamicUpdate(value= true)
public class MerchantBankAccount {
	@Id
	@Column(name = "ID")
	@GeneratedValue
	private Integer id;
	
	@Column(name = "account_name", length=512, nullable=false)
    private String accountName;
	
	@Column(name = "account_number", length=512, nullable=false)
    private String accountNumber;
	
	@Column(name = "bank_type", length=10, nullable=false)
    private String bankType;
	
	@Column(name = "bank_branch_name", length=512, nullable=false)
    private String bankBranchName;
	
	@Column(name = "currency", length=8, nullable=false)
    private String currency="NZD";
    
	@Column(name = "create_by", nullable=false)
	private Integer createBy = BusinessLogicConstants.SYSTEM_CREATOR_ID;
	
	@Column(name = "create_time", nullable=false)
	private Timestamp createTime = new Timestamp(Calendar.getInstance().getTimeInMillis());

	@Column(name = "update_by")
	private Integer updateby;

	@Column(name = "update_time")
	private Timestamp updateTime;
	
	@Column(name = "del_flag")
	private String delFlag = "F";
	
	@Column(name = "default_flag")
	private String defaultFlag = "F";	
	
	@ManyToOne(cascade=CascadeType.REFRESH)
	@JoinColumn(name="merchant_id", nullable=false)
	private MerchantInfo merchant;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getAccountName() {
		return accountName;
	}

	public void setAccountName(String accountName) {
		this.accountName = accountName;
	}

	public String getAccountNumber() {
		return accountNumber;
	}

	public void setAccountNumber(String accountNumber) {
		this.accountNumber = accountNumber;
	}

	public String getCurrency() {
		return currency;
	}

	public void setCurrency(String currency) {
		this.currency = currency;
	}

	public Integer getCreateBy() {
		return createBy;
	}

	public void setCreateBy(Integer createBy) {
		this.createBy = createBy;
	}

	public Timestamp getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	public Integer getUpdateby() {
		return updateby;
	}

	public void setUpdateby(Integer updateby) {
		this.updateby = updateby;
	}

	public Timestamp getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Timestamp updateTime) {
		this.updateTime = updateTime;
	}

	public String getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(String delFlag) {
		this.delFlag = delFlag;
	}

	public MerchantInfo getMerchant() {
		return merchant;
	}

	public void setMerchant(MerchantInfo merchant) {
		this.merchant = merchant;
	}

	public String getDefaultFlag() {
		return defaultFlag;
	}

	public void setDefaultFlag(String defaultFlag) {
		this.defaultFlag = defaultFlag;
	}

	public String getBankType() {
		return bankType;
	}

	public void setBankType(String bankType) {
		this.bankType = bankType;
	}

	public String getBankBranchName() {
		return bankBranchName;
	}

	public void setBankBranchName(String bankBranchName) {
		this.bankBranchName = bankBranchName;
	}
}